package top.ivansong.crawler;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
public class CrawlerApplication {
    public static void main(String[] args) throws Exception {
        SpringApplication.run(CrawlerApplication.class, args);
//        Document doc = Jsoup.connect("https://sjz.lianjia.com/ershoufang/pg2sf1l1/").get();
//        for (Element element : doc.getElementsByClass("LOGCLICKDATA")) {
//            if (element.tagName().equals("li")) {
//                StringBuilder stringBuilder = new StringBuilder();
//                Elements titleElements = element.getElementsByClass("title");
//                if (titleElements != null && titleElements.size() > 0) {
//                    stringBuilder.append(" title=").append(titleElements.get(0).text());
//                }
//
//                Elements positionElements = element.getElementsByClass("positionInfo");
//                if (positionElements != null && positionElements.size() > 0) {
//                    stringBuilder.append(" positionInfo=").append(positionElements.get(0).text());
//                }
//
//                Elements totalPriceElem = element.getElementsByClass("totalPrice");
//                if (totalPriceElem != null && totalPriceElem.size() > 0) {
//                    stringBuilder.append(" totalPrice=").append(totalPriceElem.get(0).text());
//                }
//                System.out.println(stringBuilder.toString());
//            }
//        }
    }
}
